﻿<UserControl x:Class="t01crm.View.CatalogMaintain"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:t01crm_Data="clr-namespace:t01crm.Data;assembly=t01crm.Data" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    xmlns:local="clr-namespace:t01crm.View" 
    d:DesignHeight="1170" d:DesignWidth="534.963" Height="649"
    Background="White"
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
    >
	<UserControl.Resources>		 
		<Style x:Key="RightAlignedLabel" TargetType="TextBlock" > 
			<Setter Property="HorizontalAlignment" Value="Right" /> 
			<Setter Property="VerticalAlignment" Value="Center" /> 
			<Setter Property="Margin" Value="0,0,4,0" /> 			
		</Style>

        <Style x:Key="ExpanderHeaderTextBlock" TargetType="TextBlock">
            <Setter Property="Foreground" Value="#FFEFEAEA" />
            <Setter Property="FontSize" Value="22" />
            <Setter Property="FontWeight" Value="Bold" />
            
        </Style>


        <Style x:Key="{x:Type TextBox}" TargetType="TextBox"> 
			<Setter Property="VerticalAlignment" Value="Center" /> 			
		</Style> 
		
		

	
        <SolidColorBrush x:Key="HeaderBackground" Color="#3E4955" />
        
        <!--<LinearGradientBrush x:Key="HeaderBackground" StartPoint="0,0" EndPoint="0,1" >
            <GradientStop Color="#9ECD42" Offset="0" />
            <GradientStop Color="#3D5808" Offset="1" />
        </LinearGradientBrush>-->
		<LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#FFF0F8FE" Offset="0"/>
			<GradientStop Color="#FFE0F3FE" Offset="0.3"/>
			<GradientStop Color="#FF6FA7C5" Offset="1"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#FFDCF0FA" Offset="0"/>
			<GradientStop Color="#FFC5E6F7" Offset="0.2"/>
			<GradientStop Color="#FF5690D0" Offset="1"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="White" Offset="0"/>
			<GradientStop Color="#FFBFBFBF" Offset="0.5"/>
			<GradientStop Color="#FF878787" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.RowDefinitions>
									<RowDefinition Height="19"/>
									<RowDefinition Height="*"/>
								</Grid.RowDefinitions>
								<Grid>
									<Grid.LayoutTransform>
										<TransformGroup>
											<TransformGroup.Children>
												<TransformCollection>
													<RotateTransform Angle="-90"/>
												</TransformCollection>
											</TransformGroup.Children>
										</TransformGroup>
									</Grid.LayoutTransform>
									<Ellipse Fill="{DynamicResource ExpanderArrowFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
									<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
								</Grid>
								<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
								<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowPressedFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="19"/>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
								<Grid>
									<Grid.LayoutTransform>
										<TransformGroup>
											<TransformGroup.Children>
												<TransformCollection>
													<RotateTransform Angle="180"/>
												</TransformCollection>
											</TransformGroup.Children>
										</TransformGroup>
									</Grid.LayoutTransform>
									<Ellipse Fill="{DynamicResource ExpanderArrowFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
									<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
								</Grid>
								<ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
								<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowPressedFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.RowDefinitions>
									<RowDefinition Height="19"/>
									<RowDefinition Height="*"/>
								</Grid.RowDefinitions>
								<Grid>
									<Grid.LayoutTransform>
										<TransformGroup>
											<TransformGroup.Children>
												<TransformCollection>
													<RotateTransform Angle="90"/>
												</TransformCollection>
											</TransformGroup.Children>
										</TransformGroup>
									</Grid.LayoutTransform>
									<Ellipse Fill="{DynamicResource ExpanderArrowFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
									<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
								</Grid>
								<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
								<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowPressedFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderHeaderFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Border>
							<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="0" SnapsToDevicePixels="true"/>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="19"/>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
								<Ellipse Fill="{DynamicResource ExpanderArrowFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
								<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
								<ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
								<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
								<Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowPressedFill}"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderStyle1" TargetType="{x:Type Expander}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
			<Setter Property="VerticalContentAlignment" Value="Stretch"/>
			<Setter Property="BorderBrush" Value="Transparent"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="BorderBrush" Value="{DynamicResource HeaderBackground}" /> 
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Expander}">
						<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
							<DockPanel>
                                <Border HorizontalAlignment="Stretch"  Background="{StaticResource HeaderBackground}"  DockPanel.Dock="Top">
                                    <ToggleButton FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" 
                                              Margin="1" MinHeight="0" MinWidth="0" x:Name="HeaderSite" 
                                              Style="{StaticResource ExpanderDownHeaderStyle}" Content="{TemplateBinding Header}" 
                                              ContentTemplate="{TemplateBinding HeaderTemplate}" 
                                              ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" 
                                              FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" 
                                              FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" 
								HorizontalAlignment="Stretch" 
								/>
                                    </Border>
								<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="false" Visibility="Collapsed" DockPanel.Dock="Bottom"/>
							</DockPanel>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsExpanded" Value="true">
								<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
							</Trigger>
							<Trigger Property="ExpandDirection" Value="Right">
								<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
								<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
								<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
							</Trigger>
							<Trigger Property="ExpandDirection" Value="Up">
								<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
								<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
								<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
							</Trigger>
							<Trigger Property="ExpandDirection" Value="Left">
								<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
								<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
								<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
        <local:CatalogMaintainViewModel x:Key="TheViewModel" d:IsDataSource="True" />
    </UserControl.Resources>

    <!--<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">-->
    <Grid Margin="5,5,5,0"  DataContext="{Binding Source={StaticResource TheViewModel}}">
            <Grid.RowDefinitions> 
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions> 
                <ColumnDefinition Width="Auto" MinWidth="400" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
        <Expander HorizontalAlignment="Stretch" VerticalAlignment="Top" IsExpanded="True" MinWidth="400"  Style="{StaticResource ExpanderStyle1}"  Grid.RowSpan="2" Margin="1,1,7,1">
                <Expander.Header >
                    <TextBlock Text="产品目录" Style="{StaticResource ExpanderHeaderTextBlock}"/>
                </Expander.Header>
            <StackPanel  Orientation="Vertical" Margin="10,10"><!--TreeViewItem.Selected="OnItemSelected"-->
                <TreeView  Name="tvCatalog"  ItemsSource="{Binding FirstGeneration,Mode=TwoWay}"   ScrollViewer.VerticalScrollBarVisibility="Auto" MaxHeight="500" Tag="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem}" SelectedItemChanged="tvCatalog_SelectedItemChanged">
                    <TreeView.ItemContainerStyle>
                        <!-- 
        This Style binds a TreeViewItem to a PersonViewModel. 
        -->
                        <Style TargetType="{x:Type TreeViewItem}">
                            <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
                            <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                            <Setter Property="FontWeight" Value="Normal" />
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="FontWeight" Value="Bold" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </TreeView.ItemContainerStyle>

                    <TreeView.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <TextBlock Text="{Binding Name}" />
                        </HierarchicalDataTemplate>
                    </TreeView.ItemTemplate>
                </TreeView>
            </StackPanel>
            
        </Expander>
            
                       
            <GridSplitter ResizeDirection="Columns" Width="5" Grid.Column="0"  Grid.RowSpan="2"  />

            <Expander  Style="{StaticResource ExpanderStyle1}" HorizontalAlignment="Stretch"   Grid.Column="2"  Grid.Row="0" IsExpanded="true" >
                <Expander.Header>
                    <TextBlock Text="维护" Style="{StaticResource ExpanderHeaderTextBlock}" />
                </Expander.Header>
            <Grid  Margin="10,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="400" />
                    
                   
                   
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" >
                    <Button Content="新增子节点" Margin="50,0,0,5" Name="btnNew" Width="100" Click="btnNew_Click"/>
                    
                    <Button Content="修改当前节点" Margin="10,0,0,5" Name="btnModify" Width="100" Click="btnModify_Click"/>
                    <Button Content="保存" Margin="10,0,0,5" Name="btnSave" Width="100" Click="btnSave_Click"/>
                    <Button Content="重置" Margin="10,0,0,5" Name="btnReset" Width="100" Click="btnReset_Click"/>

                </StackPanel>
                
                <StackPanel Grid.Row="1" Grid.Column="0">
                    <Label Margin="0,0,0,0" Name="clabPrdFatherID_MT" HorizontalAlignment="Right" >上层ID：</Label>
                </StackPanel>
                
                <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left">
                    <TextBlock  Name="tbProdFatherID_MT">
                   </TextBlock> 
                </StackPanel>

                <StackPanel Grid.Row="2" Grid.Column="0">
                    <Label Margin="0,0,0,0" Name="clabPrdID_MT" HorizontalAlignment="Right">ID：</Label>
                </StackPanel>
                <StackPanel Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left">
                    <TextBlock  Name="tbProdID_MT">
                  
                    </TextBlock>
                </StackPanel>
                <StackPanel Grid.Row="3" Grid.Column="0">
                    <Label Margin="0,0,0,0" Name="clabPrdName_MT" HorizontalAlignment="Right">名称：</Label>
                </StackPanel>
                <StackPanel Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" >

                    <TextBox  Width="200" Name="txtProdName_MT"> </TextBox>

                </StackPanel>
               
            </Grid> 
        </Expander>
        <Expander  Style="{StaticResource ExpanderStyle1}" HorizontalAlignment="Stretch"   Grid.Column="2"  Grid.Row="1"  IsExpanded="true" >
            <Expander.Header>
                <TextBlock Text="当前节点" Style="{StaticResource ExpanderHeaderTextBlock}" />
            </Expander.Header>
            <Grid  Margin="10,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="400" />



                </Grid.ColumnDefinitions>
                

                <StackPanel Grid.Row="0" Grid.Column="0">
                    <Label Margin="0,0,0,0" Name="clabPrdFatherID" HorizontalAlignment="Right" >上层ID：</Label>
                </StackPanel>

                <StackPanel Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left">
                    <TextBlock DataContext="{Binding ElementName=tvCatalog, Path=SelectedItem}" Name="tbProdFatherID">
                    <TextBlock.Text>
                        <Binding Path="FatherID" />
                    </TextBlock.Text>
                    </TextBlock>

                </StackPanel>
                <StackPanel Grid.Row="1" Grid.Column="0">
                    <Label Margin="0,0,0,0" Name="clabPrdID" HorizontalAlignment="Right">ID：</Label>
                </StackPanel>
                <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left">
                    <TextBlock DataContext="{Binding ElementName=tvCatalog, Path=SelectedItem}" Name="tbProdID">
                    <TextBlock.Text>
                        <Binding Path="ID" />
                    </TextBlock.Text>
                    </TextBlock>
                </StackPanel>
                <StackPanel Grid.Row="2" Grid.Column="0">
                    <Label Margin="0,0,0,0" Name="clabPrdName" HorizontalAlignment="Right">名称：</Label>
                </StackPanel>
                <StackPanel Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" >

                 
                    <TextBlock DataContext="{Binding ElementName=tvCatalog, Path=SelectedItem}" Name="tbProdName">
                    <TextBlock.Text>
                        <Binding Path="Name" />
                    </TextBlock.Text>
                    </TextBlock>
                </StackPanel>

            </Grid>
        </Expander>
    </Grid>
    <!--</ScrollViewer>--> 
</UserControl>
